package com.zyh.homework.test6.domain;

public class Rectangle extends Graphic{
    private double chang;
    private double kuan;

    public Rectangle() {
    }
    public Rectangle(double chang, double kuan) {
        this.chang = chang;
        this.kuan = kuan;
    }

    @Override
    public double getArea() {
        return getChang()*getKuan();
    }

    @Override
    public double getPerimeter() {
        return (getChang()+getKuan())*2;
    }

    @Override
    public String getInfo() {
        return "矩形的长是"+getChang()+"宽是"+getKuan()+"面积是"+getArea()+"周长是"+getPerimeter();
    }

    public double getChang() {
        return chang;
    }

    public void setChang(double chang) {
        this.chang = chang;
    }

    public double getKuan() {
        return kuan;
    }

    public void setKuan(double kuan) {
        this.kuan = kuan;
    }
}
